<template>
  <div class="HomeSwiper">
    <div class="row">
      <div class="col p-0">
        <div class="wrap">
          <div class="swiper-wrap">
            <swiper :options="swiperOption" ref="mySwiper" v-if="disSwiper">
              <swiper-slide v-for="item of swiperList" :key="item.id">
                <img :src="item.img" class="w-100" alt>
              </swiper-slide>
              <div class="swiper-pagination" slot="pagination"></div>
            </swiper>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "HomeSwiper",
  props: {
    swiperList: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      swiperOption: {
        autoplay: true,
        speed: 3000,
        pagination: {
          el: ".swiper-pagination",
          type: "fraction"
        },
        loop: true
      }
    };
  },
  computed: {
    disSwiper() {
      return this.swiperList.length;
    }
  }
};
</script>


<style scoped>
.wrap {
  color: #fff;
}
</style>
